<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<jsp:directive.include file="seguranca/controleDeAcesso.jsp" />

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Minha Biblioteca</title>
</head>
<body>
	<f:view>
		<h:inputHidden value="#{usuarioMB.usuario.id}" />
		<h2>
			Biblioteca de <h:outputText value="#{usuarioMB.usuario.nome}"></h:outputText>
		</h2>
	<h:form>
		<h4>				
				Pesquisar: <h:inputText id="titulo" value="#{livroMB.titulo}"></h:inputText>
				<h:commandButton value="pesquisar livro" action="pesquisaLivros.jsp">
				<f:setPropertyActionListener value="#{livroMB.titulo}" target="#{livroMB.titulo}"/>
				</h:commandButton>			
				
		</h4>
	</h:form>
	</br>
	
		<h:outputText style="color: #0000FF" value="#{livroMB.msgOk}"
			rendered="#{livroMB.comMsgOk}"></h:outputText>	
	
	<h:form>
	<h:panelGrid border="1" columns="3">
		<h:commandLink action="listaAcervo.jsp" >
			<h4><h:outputText value="Listar Acervo"></h:outputText></h4>
			<f:setPropertyActionListener value="#{usuarioMB.usuario.id}" target="#{livroMB.id}"/>
		</h:commandLink>
		<h:commandLink action="cadastrarLivro.jsp" >
			<h4><h:outputText value="Cadastrar um novo Livro"></h:outputText></h4>
			<f:setPropertyActionListener value="#{usuarioMB.usuario.id}" target="#{livroMB.id}"/>
		</h:commandLink>
		<h:commandLink action="listaUsuarios.jsp">
			<h4><h:outputText value="Lista de Usuários"></h:outputText></h4>
			<f:setPropertyActionListener value="#{usuarioMB.usuario.id}" target="#{usuarioMB.id}"/>						
		</h:commandLink>
		</h:panelGrid>
	</h:form>		                                                   
		</br>
		
		<h:form>
			<h:commandLink action="#{usuarioMB.logout}" >
				<h:outputText value="Efetuar Logout"></h:outputText>
			</h:commandLink>
		</h:form>

	</f:view>
</body>
</html>